home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC / include / afxdllx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  2.6 KB  |  73 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. /////////////////////////////////////////////////////////////////////////////
  12. // AFXDLLX.H: Extra header for building an MFC Extension DLL
  13. //
  14. // This file is really a source file that you should include in the
  15. // main source file of your DLL.  It must only be included once, and
  16. // not multiple times (you will get linker errors if it is included
  17. // multiple times).  If you do not use _AFXEXT, it is not required
  18. // but you may want the feature it provides.
  19. //
  20. // Previous versions of 32-bit MFC did not require this file.  This version
  21. // requires this file to support dynamic loading of extension DLLs.  In
  22. // other words, if your application does LoadLibrary on any extension
  23. // DLL (instead of binding to the DLL at link time), this file is
  24. // required.
  25.  
  26. #ifdef _AFX_MINREBUILD
  27. #pragma component(minrebuild, off)
  28. #endif
  29. #ifndef _AFX_FULLTYPEINFO
  30. #pragma component(mintypeinfo, on)
  31. #endif
  32.  
  33. // The following symbol used to force inclusion of this module for _AFXEXT
  34. #if defined(_X86_)
  35. extern "C" { int _afxForceEXTDLL; }
  36. #else
  37. extern "C" { int __afxForceEXTDLL; }
  38. #endif
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // RawDllMain that saves current app class list and factory list
  42.  
  43. extern "C" BOOL WINAPI ExtRawDllMain(HINSTANCE, DWORD dwReason, LPVOID);
  44. extern "C" BOOL (WINAPI* _pRawDllMain)(HINSTANCE, DWORD, LPVOID) = &ExtRawDllMain;
  45.  
  46. extern "C"
  47. BOOL WINAPI ExtRawDllMain(HINSTANCE, DWORD dwReason, LPVOID)
  48. {
  49.     if (dwReason == DLL_PROCESS_ATTACH)
  50.     {
  51.         // save critical data pointers before running the constructors
  52.         AFX_MODULE_STATE* pModuleState = AfxGetModuleState();
  53.         pModuleState->m_pClassInit = pModuleState->m_classList;
  54. #ifndef _AFX_NO_OLE_SUPPORT
  55.         pModuleState->m_pFactoryInit = pModuleState->m_factoryList;
  56. #endif
  57.         pModuleState->m_classList.m_pHead = NULL;
  58. #ifndef _AFX_NO_OLE_SUPPORT
  59.         pModuleState->m_factoryList.m_pHead = NULL;
  60. #endif
  61.     }
  62.     return TRUE;    // ok
  63. }
  64.  
  65. #ifdef _AFX_MINREBUILD
  66. #pragma component(minrebuild, on)
  67. #endif
  68. #ifndef _AFX_FULLTYPEINFO
  69. #pragma component(mintypeinfo, off)
  70. #endif
  71.  
  72. /////////////////////////////////////////////////////////////////////////////
  73.